package net.lab1024.sa.admin.module.business.aps.constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * APS状态枚举
 *
 * @Author 1024创新实验室
 * @Date 2025-01-28
 * @Wechat zhuoda1024
 * @Email lab1024@163.com
 * @Copyright <a href="https://1024lab.net">1024创新实验室</a>
 */
@Getter
@AllArgsConstructor
public enum ApsStatusEnum {

    /**
     * 待计划
     */
    PENDING(0, "待计划"),

    /**
     * 计划中
     */
    PLANNING(1, "计划中"),

    /**
     * 已完成
     */
    COMPLETED(2, "已完成"),

    /**
     * 已取消
     */
    CANCELLED(3, "已取消");

    private final Integer value;

    private final String desc;

    public static ApsStatusEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (ApsStatusEnum statusEnum : values()) {
            if (statusEnum.getValue().equals(value)) {
                return statusEnum;
            }
        }
        return null;
    }
}